//
//  AreaUtils.m
//  CarTown
//
//  Created by xionghao on 15/9/9.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "AreaUtils.h"
#import "Area.h"
@implementation AreaUtils
+(void)getArea:(void (^)(bool))su{
    NSMutableDictionary *params=[NSMutableDictionary dictionary];
    params[@"action"]=@"area";
    [PostUitls Post:qburl parameters:params success:^(id response) {
        
        NSDictionary *dict=response;
        
        NSNumber *state=dict[@"state"];
        
        if ([state integerValue]==400) {
            [Area addArea:dict[@"data"]];
        }
        if (su) {
            su(YES);
        }
        
    } failure:^(NSError *error) {
        if (su) {
            su(NO);
        }
    }];

}
@end
